home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / texte / 7up_pd / math.h < prev    next >
Text File  |  1998-10-29  |  5KB  |  157 lines

  1. /*      MATH.H
  2.  
  3.         Mathematical Definition Includes
  4.  
  5.         Copyright (c) Borland International 1990
  6.         All Rights Reserved.
  7. */
  8.  
  9.  
  10. #if !defined( __MATH )
  11. #define __MATH
  12.  
  13. #define HUGE_VAL        1.189731495357231765E+4932
  14.  
  15. #define M_E             2.71828182845904523536
  16. #define M_LOG2E         1.44269504088896340736
  17. #define M_LOG10E        0.434294481903251827651
  18. #define M_LN2           0.693147180559945309417
  19. #define M_LN10          2.30258509299404568402
  20. #define M_PI            3.14159265358979323846
  21. #define M_PI_2          1.57079632679489661923
  22. #define M_PI_4          0.785398163397448309116
  23. #define M_1_PI          0.318309886183790671538
  24. #define M_2_PI          0.636619772367581343076
  25. #define M_1_SQRTPI      0.564189583547756286948
  26. #define M_2_SQRTPI      1.12837916709551257390
  27. #define M_SQRT2         1.41421356237309504880
  28. #define M_SQRT_2        0.707106781186547524401
  29.  
  30. double  fabs( double x );
  31. double  ceil( double x );
  32. double  floor( double x );
  33. double  round( double x );
  34. double  trunc( double x );
  35.  
  36. double  fmod( double x, double y );
  37. double  exp( double x );
  38. double  log( double x );
  39. double  log10( double x );
  40.  
  41. double  frexp( double x, int *nptr );
  42. double  ldexp( double x, int n );
  43. double  modf( double x, double *nptr );
  44.  
  45. double  pow( double x, double y );
  46. double  pow10( int i );
  47. double  sqrt( double x );
  48.  
  49. double  cos( double x );
  50. double  sin( double x );
  51. double  tan( double x );
  52. void    sincos( double x, double *sin, double *cos );
  53.  
  54. double  acos( double x );
  55. double  asin( double x );
  56. double  atan( double x );
  57. double  atan2( double x, double y );
  58. double  cosh( double x );
  59. double  sinh( double x );
  60. double  tanh( double x );
  61.  
  62. double  acosh( double x );
  63. double  asinh( double x );
  64. double  atanh( double x );
  65.  
  66. int     ftoa( double *x, char *resStr, int ndig, int format,
  67.               int *decPnt, int *sign );
  68.  
  69. double  atof( const char *digStr );
  70.  
  71.  
  72. typedef enum
  73. {
  74.          DOMAIN = 1,    /* argument domain error -- log (-1)      */
  75.          SING,          /* argument singularity  -- pow (0,-2))   */
  76.          OVERFLOW,      /* overflow range error  -- exp (1000)    */
  77.          UNDERFLOW      /* underflow range error -- exp (-1000)   */
  78. } mexcep;
  79.  
  80. struct exception
  81. {
  82.     mexcep      type;
  83.     char        *name;
  84.     double      arg1;
  85.     double      arg2;
  86.     double      retval;
  87. };
  88.  
  89.  
  90. void    setmatherr( int (*errorfunc)( struct exception *e ) );
  91. int     fpumode( int disable );
  92. void    xdcnv( double *val, void *rep8bytes );
  93. void    dxcnv( void *rep8bytes, double *val );
  94.  
  95. #if defined( __68881__ )
  96. double  fint( double x );
  97. double  fintrz( double x );
  98. double  fgetexp( double x );
  99. double  fgetman( double x );
  100. double  frem( double x, double y );
  101. double  fsgldiv( double x, double y );
  102. double  fsglmul( double x, double y );
  103. double  fetoxm1( double x );
  104. double  flognp1( double x );
  105. double  pow2( double x );
  106. #endif
  107.  
  108. #if defined( __68881__ ) && !defined( __NFPUIN__ )
  109.                                               /* MC68881 extensions */
  110. /* Arithmetische Befehle: */
  111. #define trunc( x )      __FINTRZ__( x )
  112. #define fabs( x )       __FABS__( x )
  113. #define fgetexp( x )    __FGETEXP__( x )
  114. #define fgetman( x )    __FGETMAN__( x )
  115. #define fint( x )       __FINT__( x )
  116. #define fintrz( x )     __FINTRZ__( x )
  117. #define fmod( x, y )    __FMOD__( y, x )
  118. #define frem( x, y )    __FREM__( y, x )
  119. #define ldexp( x, y )   __FSCALE__( y, x )
  120. #define fsgldiv( x, y ) __FSGLDIV__( y, x )
  121. #define fsglmul( x, y ) __FSGLMUL__( y, x )
  122.  
  123. /* Potenzen und Logarithmen: */
  124. #define exp( x )        __FETOX__( x )
  125. #define fetoxm1( x )    __FETOXM1__( x )
  126. #define log( x )        __FLOGN__( x )
  127. #define flognp1( x )    __FLOGNP1__( x )
  128. #define log10( x )      __FLOG10__( x )
  129. #define log2( x )       __FLOG2__( x )
  130. #define sqrt( x )       __FSQRT__( x )
  131. #define pow10( x )      __FTENTOX__( x )
  132. #define pow2( x )       __FTWOTOX__( x )
  133.  
  134. /* Trigonometrie: */
  135. #define acos( x )       __FACOS__( x )
  136. #define asin( x )       __FASIN__( x )
  137. #define atan( x )       __FATAN__( x )
  138. #define cos( x )        __FCOS__( x )
  139. #define sin( x )        __FSIN__( x )
  140. #define tan( x )        __FTAN__( x )
  141.  
  142. /* Hyperbelfunktionen: */
  143. #define atanh( x )      __FATANH__( x )
  144. #define cosh( x )       __FCOSH__( x )
  145. #define sinh( x )       __FSINH__( x )
  146. #define tanh( x )       __FTANH__( x )
  147.  
  148. /* Conversionsfunktionen nur für TC881LIB.LIB */
  149. double x80x96cnv( void *rep10bytes );
  150. void   x96x80cnv( double rep12bytes, void *rep10bytes );
  151.  
  152. #endif
  153.  
  154. #endif
  155.  
  156. /************************************************************************/
  157. ə